<template>
	<!-- 活动子组件 -->
	<!-- 顶图 -->
	<view class="top-slider">
		<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
				:duration="duration">
			<swiper-item v-for="(item,index) in activityData.data" :key="index">  
				<view class="swiper-item">
					<image :src="item.gameBannerLink" mode="widthFix"></image>
					<view class="corner-sign"></view>
				</view>
				<view class="wiper-item-info">
					<view class="item-info"><icon type="" class="fontIcon icon-number-hot"/>{{get(item)}}</view>
					<view class="item-number"><text class="current-number">{{index+1}}</text>/{{activityData.data.length}}</view> 
				</view>
			</swiper-item>
		</swiper>
		<!-- 这个结构必须放在上边的位置，不然拿不到遍历出来的每一个数值-->
		<!-- <view class="wiper-item-info">
			<view class="item-info"><icon type="" class="fontIcon icon-number-hot"/>{{item.fLooknum}}</view>
			<view class="item-number"><text class="current-number">1</text>/100</view>
		</view> -->
	</view>
</template>

<script lang="ts" setup>
	import {ref , onBeforeMount, reactive} from "vue"
	import { HTTP_API_URL } from '@/common/consts/Consts';
	import { HttpMethod, httpUtil } from '@/common/netWork/httpUtil';
	interface Props{
			ssData:any,
			
		}
	let autoplay = ref(true)
	let interval = ref(2000)
	// let props = defineProps<Props>() 
	let activityData = reactive({
		data:{}
	})
	// console.log(activityData)
	const get=(item:any)=>{
		return item.fLooknum + item.lookNum
	}
	const getSS = async ()=>{
		let {data}=  await httpUtil.request(HTTP_API_URL.MSG_MAOZASA,HttpMethod.POST,{"cityCode":"9999"})
		console.log(JSON.parse(data))
		activityData.data = JSON.parse(data).sort((a:any,b:any)=>a.sort-b.sort)		  
		console.log('asdasd',activityData.data)
	}
	onBeforeMount(()=>{
		 getSS()
	})
</script>

<style>

</style>